<?php
    $uid = $_SESSION['user_id'];

    $where1 = array();
    $where1['uid'] = $uid;
    $where1['type'] = 1;
    $stime1 = date('Y-m-d',strtotime('-1 day'))." 00:00:00";//昨天开始时间
    $etime1 = date('Y-m-d',strtotime('-1 day'))." 23:59:59";//昨天结束时间
    $stimes1 = strtotime($stime1);
    $etimes1 = strtotime($etime1);
    $where1['ctime'] = array(array('egt',$stimes1),array('elt',$etimes1));

    $where2 = array();
    $where2['uid'] = $uid;
    $stime2 = date('Y-m-d',strtotime('-1 day'))." 00:00:00";//当天开始时间
    $etime2 = date('Y-m-d',strtotime('-1 day'))." 23:59:59";//当天结束时间
    $stimes2 = strtotime($stime2);
    $etimes2 = strtotime($etime2);
    $where2['ctime'] = array(array('egt',$stimes2),array('elt',$etimes2));
    $arr = M("jiaoyi")->where($where1)->select();


    $where3 = array();
    $where3['uid'] = $uid;
    $where3['type'] = 2;
    $stime3 = date('Y-m-d',strtotime('-1 day'))." 00:00:00";//当天开始时间
    $etime3 = date('Y-m-d',strtotime('-1 day'))." 23:59:59";//当天结束时间
    $stimes3 = strtotime($stime3);
    $etimes3 = strtotime($etime3);
    $where3['ctime'] = array(array('egt',$stimes3),array('elt',$etimes3));
    $arr2 = M("jiaoyi")->where($where3)->select();


   if(empty($uid) || empty($arr)){
        $zuo = 0 ;
   }else{
       $data =M("jiaoyi")->where($where1)->select();
       foreach($data as $v){
          $jiaoyi_ctime  += $v['ctime'];
       }

        $date = M("order")->where($where2)->select();
        $shu = count($date);
        foreach($date as $v){
              $order_ctime  += $v['ctime'];
        }
       $chazhi =  round(($jiaoyi_ctime - $order_ctime)/$shu);
       $tiao = round(($chazhi/3600)*100);
        $ctimes = date('i:s',$chazhi) ;
        $dd = substr($ctimes,0,2);
        if(substr($ctimes,0,1)==0){
          $ii = substr($ctimes,1,1);
        }else{
          $ii = substr($ctimes,0,2);
        }
        if(substr($ctimes,3,1)==0){
           $ss = substr($ctimes,4,1);
        }else{
           $ss = substr($ctimes,3,2);
        }
   }


        if(empty($uid) || empty($arr2)){
            $zuo2 = 0 ;
        }else{
            $data1 =M("jiaoyi")->where($where3)->select();
            foreach($data1 as $v){
                $jiaoyi_ctime2  += $v['ctime'];
            }
            $date2 = M("tixian")->where($where2)->select();
            $shu2 = count($date2);
            foreach($date2 as $v){
                 $tixian_ti_time  += $v['ti_time'];
             }

            $chazhi2 =  round(($tixian_ti_time - $jiaoyi_ctime2)/$shu2);
            $tiao2 = round(($chazhi2/3600)*100);
            $ctimes2 = date('i:s',$chazhi2);
            $dd2 = substr($ctimes2,0,2);
            if(substr($ctimes2,0,1)==0){
               $ii2 = substr($ctimes2,1,1);
            }else{
               $ii2 = substr($ctimes2,0,2);
            }
            if(substr($ctimes2,3,1)==0){
               $ss2 = substr($ctimes2,4,1);
            }else{
               $ss2 = substr($ctimes2,3,2);
            }
        }
?>


<div data-v-270904ef="" class="footer mgt40">

        <div data-v-270904ef="" class="ftadCon">
            <div data-v-270904ef="" class="container">
                <ul data-v-270904ef="" class="ftad fix">
                    <li data-v-270904ef="">
                        <!--<a data-v-270904ef="" id="dafaCloud" href="" target="_blank">-->
                            <p data-v-270904ef="">技术支持<i data-v-270904ef="">Technical
                        support</i></p>

                        <div data-v-270904ef="" class="technicalSupport fix">
                            <img data-v-270904ef="" src="/style/images/dafayun.png" alt="大发云">

                            <p data-v-270904ef="">
                                十分彩
                                <br data-v-270904ef=""> 专业的彩票系统平台
                            </p> <i data-v-270904ef=""></i></div>
                    <!--</a>-->
                    </li>
                    <li data-v-270904ef="">
                        <p data-v-270904ef="">服务体验<i data-v-270904ef="">Service experience</i></p>
                        <ul data-v-270904ef="" class="serviceExperience">
                            <li data-v-270904ef="">昨日充值到账平均时间
                                <p data-v-270904ef="" class="footBar">
                                    <span data-v-270904ef="" class="s1" style="width: <?php if(empty($uid) || empty($arr)){echo $zuo;}else{echo $tiao;}  ?>%"></span>
                                </p>
                                <em data-v-270904ef=""><?php if(empty($uid) || empty($arr)){echo $zuo;}else{echo $ii."'".$ss;} ?></em>
                                <i data-v-270904ef="">秒</i>
                            </li>
                            <li data-v-270904ef="">昨日提现到账平均时间
                                <p data-v-270904ef="" class="footBar">
                                    <span data-v-270904ef="" class="s2" style="width: <?php if(empty($uid) || empty($arr2)){echo $zuo2;}else{echo $tiao2;}  ?>%;"></span>
                                </p>
                                <em data-v-270904ef="" id="timer"><?php if(empty($uid) || empty($arr2)){echo $zuo2;}else{echo $ii2."'".$ss2;} ?></em>
                                <i data-v-270904ef="">秒</i>
                            </li>
                        </ul>
                    </li>
                    <li data-v-270904ef=""><p data-v-270904ef="">充值方式<i data-v-270904ef="">Recharge method</i></p>

                        <div data-v-270904ef="" class="rechargeMethod"><i data-v-270904ef="" class="wechat"></i><i
                                data-v-270904ef="" class="alipay"></i><i data-v-270904ef="" class="cup"></i></div>
                    </li>
                </ul>
            </div>
        </div>
        <div data-v-270904ef="" class="container _about aboutText">
            <p data-v-270904ef="" class="fix">
                <a data-v-270904ef="" href="{:U('Index/about_31')}">关于我们</a>|
                <a data-v-270904ef="" href="{:U('Index/about_32')}">联系我们</a>|
                <a data-v-270904ef="" href="{:U('Index/about_33')}">商务合作</a>|
                <a data-v-270904ef="" href="{:U('Index/about_34')}">法律声明</a>|
                <a data-v-270904ef="" href="{:U('Index/about_35')}">隐私声明</a>|
            </p>

            <p data-v-270904ef="" class="copyright">Copyright © <span data-v-270904ef="" class="siteName">十分彩网</span>
                Reserved | 18+</p></div>
    </div>